-
-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support negative globs #1324
Conversation
I just tested it. thank you @pd93 It works like a charm <3 however the '!' needs special care as it is special character in YML. without it it is possible to encounter: https://stackoverflow.com/a/22235064 my working example:
I hope it will be released soon ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid YAML issues with !
we could move to a proper key like not:
, ignore:
or exclude:
. What do you think?
version: '3'
tasks:
css:
sources:
- mysources/**/*.css
- exclude: mysources/ignoreme.css
generates:
- public/bundle.css
I think I would chose exclude:
, but I'm open to opinions.
yep, it's nice ;) also opting for |
can't wait to see it released ;) @andreynering |
Yeah, |
Hey @pd93, Can you change to use |
@pd93 any chance that you will do it this month? :) From my perspective it's pretty annoying and I would be glad to have it improved. If you have no time to complete this, just let me know I will improve it. |
b11d40a
to
957cce5
Compare
Co-authored-by: Andrey Nering <[email protected]>
957cce5
to
91b8674
Compare
Fixes #225
This PR adds native support for negating a glob pattern in Task. e.g.
It works by looping over an array of patterns in order. If a pattern is normal, the files are added to a map with a value of
true
(i.e. the files should be included). if a pattern begins with a!
, then all the files matched by that pattern are added to (or updated in) the map with a value offalse
(i.e. they should not be included). We then loop through the map and convert all keys with a value oftrue
into a slice. This slice is then sorted and returned.